<%@ include file="database_ini.jsp"%>

<%
//     listname     code     description     short     long_value     notes
String serialkey=request.getParameter("serialkey");
int num=Integer.parseInt(serialkey);
String listname=request.getParameter("listname");
String code=request.getParameter("code");
String description=request.getParameter("description");
String short_value=request.getParameter("short");
String long_value=request.getParameter("long_value");
String notes=request.getParameter("notes");

//	st=con.createStatement();
//	st.executeUpdate("update codelkup set listname='"+listname+"',code='"+code+"',description='"+description+"',short='"+short_value+"',long_value='"+long_value+"',notes='"+notes+"' where serialkey='"+num+"'");
//	response.sendRedirect("application.jsp?listname="+listname);

String sql = "update codelkup set listname= ?,code=?,description=?,short=?,long_value=?,notes=? where serialkey= ?";

PreparedStatement pstmt = null; 
pstmt=conn.prepareStatement(sql);
pstmt.setString(1 , listname);
pstmt.setString(2 , code);
pstmt.setString(3 , description);
pstmt.setString(4 , short_value);
pstmt.setString(5 , long_value);
pstmt.setString(6 , notes);					
pstmt.setInt(7 , num);
pstmt.executeUpdate();

//out.print("<CENTER>Delete success!</CENTER>");
//response.setHeader("Refresh" , "1;url=application.jsp?listname="+ listname);
response.sendRedirect("application.jsp?listname="+listname);

%>
